package com.zzy.service;

import com.zzy.model.CompleteParams;
import com.zzy.model.Leave;
import org.hibernate.Criteria;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

public interface LeaveService {
    /**
     * 根据HQL和条件
     * 获取User实体
     * @param hql
     * @param param
     * @return
     */
    public Leave getUnique(String hql, Object param[]);

    /**
     * 根据UID获取用户实体
     * @param id
     * @return User
     */
    public Leave getByID(String id);


    /**
     * 分页获取 用户 列表
     * @param hql
     * @param param
     * @param page
     * @param rows
     * @return List<Leave>
     */
    public List<Leave> getPage(String hql , Object param[],Integer page,Integer rows);
    public List<Leave> getPage(Criteria cr, Integer page, Integer rows);
    public List<Leave> getList(String hql, Object param[]);
    public List<Leave> getList(Criteria cr);



    /**
     * 获取List的条数
     * "select count(*) from User where ... "
     *
     */
    public Integer getTotalNum(String hql,Object param[]);

    /**
     * 添加新用户
     * 1成功-1失败
     * @param model
     * @return int
     */
    public Integer save(Leave model);
    /**
     * 根据Uid删除用户
     * 1成功-1失败
     * @param id
     * @return int
     */
    public Integer del(String id);
    /**
     * 更新
     * 1成功-1失败
     * @param model
     * @return int
     */
    public Integer update(Leave model);

    /**
     * 保存或者更新
     * 1成功-1失败
     * @param model
     * @return int
     */
    public Integer saveOrUpdate(Leave model);

    /**
     * 审核
     */
   public void audit(CompleteParams params, MultipartFile[] files);


}
